-- region *.lua
-- Date
-- 此文件由[BabeLua]插件自动生成


yh_mpu6050.init(1, 2)

tmr.alarm(0, 1000, 1, function()
    c = yh_mpu6050.read()


    Ax = bit.lshift(string.byte(c, 1), 8) + string.byte(c, 2)
    Ay = bit.lshift(string.byte(c, 3), 8) + string.byte(c, 4)
    Az = bit.lshift(string.byte(c, 5), 8) + string.byte(c, 6)
    Gx = bit.lshift(string.byte(c, 9), 8) + string.byte(c, 10)
    Gy = bit.lshift(string.byte(c, 11), 8) + string.byte(c, 12)
    Gz = bit.lshift(string.byte(c, 13), 8) + string.byte(c, 14)

    temp = bit.lshift(string.byte(c, 7), 8) + string.byte(c, 8)

    print("Ax:" .. Ax .. "     Ay:" .. Ay .. "      Az:" .. Az)
    print("Gx:" .. Gx .. "   Gy:" .. Gy .. "   Gz:" .. Gz)
    --  print("\nTempH: "..string.byte(c, 7).." TempL: "..string.byte(c, 8).."\n")
    print("temp:" .. temp)
end )



-- endregion
